Telegram Group & Telegram Channel
Переводим питонячий в человеческий

Нашел офигенный пакет humanize, который может переводить числа и даты в читаемый для человека текст. То есть все костыли для таких задач сразу заменяются буквально одной строчкой.

К примеру, из сложного объекта timedelta можно получить "2 дня, 1 час и 33.12 секунд" или же "5.00 x 10²" из числа 500. Больше примеров можете посмотреть на картинке, прикрепленной к посту.

Но что еще круче, помимо английского, пакет поддерживает много других языков, включая русский. И вообще рекомендую почитать их документацию, там много интересных функций.

#humanize



tg-me.com/python_academy/998
Create:
Last Update:

Переводим питонячий в человеческий

Нашел офигенный пакет humanize, который может переводить числа и даты в читаемый для человека текст. То есть все костыли для таких задач сразу заменяются буквально одной строчкой.

К примеру, из сложного объекта timedelta можно получить "2 дня, 1 час и 33.12 секунд" или же "5.00 x 10²" из числа 500. Больше примеров можете посмотреть на картинке, прикрепленной к посту.

Но что еще круче, помимо английского, пакет поддерживает много других языков, включая русский. И вообще рекомендую почитать их документацию, там много интересных функций.

#humanize

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/998

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

Telegram hopes to raise $1bn with a convertible bond private placement

The super secure UAE-based Telegram messenger service, developed by Russian-born software icon Pavel Durov, is looking to raise $1bn through a bond placement to a limited number of investors from Russia, Europe, Asia and the Middle East, the Kommersant daily reported citing unnamed sources on February 18, 2021.The issue reportedly comprises exchange bonds that could be converted into equity in the messaging service that is currently 100% owned by Durov and his brother Nikolai.Kommersant reports that the price of the conversion would be at a 10% discount to a potential IPO should it happen within five years.The minimum bond placement is said to be set at $50mn, but could be lowered to $10mn. Five-year bonds could carry an annual coupon of 7-8%.

How Does Telegram Make Money?

Telegram is a free app and runs on donations. According to a blog on the telegram: We believe in fast and secure messaging that is also 100% free. Pavel Durov, who shares our vision, supplied Telegram with a generous donation, so we have quite enough money for the time being. If Telegram runs out, we will introduce non-essential paid options to support the infrastructure and finance developer salaries. But making profits will never be an end-goal for Telegram.

Python Academy from de


Telegram Python Academy
FROM USA